﻿@model ListViewModel<CommonSearchValues, IQueryable<QizSession>>
@{
    ViewBag.Title = "常规随访单查询";
}
@using (Ajax.BeginForm("QizSessionList", new { _dataonly = "yes" }, new AjaxOptions
{ HttpMethod = "Post", LoadingElementId = "OnLoadingSpan", UpdateTargetId = "ListView",
OnFailure = "OnSiteError" })) {<p>
    <fieldset>
        <legend>
            <div class="catalog-title">
                常规随访单查询</div>
        </legend>
        @Html.Action("SFReport")
        <div class="small-input">
            @Html.HiddenFor(m => Model.PageSize)
           <input type="hidden" name="PageIdx" id="qspidx" value="0" />
            随访单名称： @Html.TextBoxFor(m => m.SearchFrom.V4, new { ID = "CV" }) @*, new SelectList(ViewBag.Subjects, "ID", "Title", Model.SearchFrom.V1), "全部")*@
            <a title="选择常规随访。数据很多，请耐心等待..." href="#" onclick="$('#dialogbox').load('@(Url.Action("QizSubjectTree"))',null,function(){showDialogEx('#dialogbox','请选择',true);});return false;">
                [选择…]</a>
            &nbsp;&nbsp;填报人：@Html.TextBoxFor(m => m.SearchFrom.V2) @*, new SelectList(ViewBag.Recupers, "UserID", "UserName", Model.SearchFrom.V2), "全部")*@
            &nbsp;&nbsp;开始时间：@Html.EditorFor(m => m.SearchFrom.V3, "DateTimeStr")
            结束时间：@Html.EditorFor(m => m.SearchTo.V3, "DateTimeStr")
            @Helpers.SubmitButton("查询", "qssubmit")
        </div>
        
    </fieldset>
</p>
}

<table class="width">
    <tr>
        <th>
            随访单名称
        </th>
        <th>
            医院
        </th>
        <th>
            科室
        </th>
         <th>
            病区
        </th>
        <th>
            医生
        </th>
        <th>
            填报人
        </th>
        <th>
            填报时间
        </th>
        <th>
            填报方式
        </th>           
    </tr>
    @{int dColor = 0;}
    @foreach (var item in Model.Data)
    {
        <tr class="tr-backColor@(dColor++ % 2)" style="@(item.SessionAutoEvaluation == "异常" ? "color:red" : "")">
            <td>
            @Html.ActionLink(item.QizSubject.Title, "QizSessionEdit", new { ID = item.ID, PreviewOnly = true, _newpage = "true" }, new { target = "_blank" })
            @*@Html.DisplayFor(model => item.QizSubject.Title)*@
            </td>
            <td>@Html.DisplayFor(model => item.QizSubject.Hospital.HospName)
            </td>
            <td>@Html.DisplayFor(model => item.QizSubject.Department.BingQu.Title)
            </td>
            <td>@Html.DisplayFor(model => item.QizSubject.Department.DepName)
            </td>
            <td>  
                @try
                {
            @(item.ParentQizSession == null ? item.QizSubject.QizSubjectObjForDoctors.First().Doctor.UserName : item.ParentQizSession.QizSubject.QizSubjectObjForDoctors.First().Doctor.UserName)
                }
                catch
                {
                    <div class="error">ERROR:
                    @(item.ParentQizSession == null ? "随访": "化验单")
                    @(item.ParentQizSession == null ? item.QizSubjectID : item.ParentQizSession.QizSubjectID)
                    </div>
                }

            </td>
            <td>@Html.DisplayFor(model => item.Recuper.User.UserName)
            </td>
            <td>@Html.DisplayFor(model => item.CreationTime)
            </td>
            <td>网络
            </td>
        </tr>
    }
</table>
@Html.Partial("Pagger", new PaggerViewModel { Act = "QizSessionList", PageIdx = Model.PageIdx, PageCount = Model.PageCount, ItemCount = Model.ItemCount })
@Html.Partial("TrHilighter")